home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / fgl105c.zip / 10-03.C < prev    next >
Text File  |  1991-05-05  |  666b  |  35 lines

  1. main()
  2. {
  3.    int old_mode;
  4.    int x;
  5.  
  6.    /* initialize the video environment */
  7.  
  8.    if (fg_testmode(13,1) == 0) {
  9.       printf("This program requires EGA.\n");
  10.       exit();
  11.       }
  12.    old_mode = fg_getmode();
  13.    fg_setmode(13);
  14.    fg_setfunc(3);
  15.  
  16.    /* draw some type of background */
  17.  
  18.    fg_setcolor(15);
  19.    fg_rect(0,319,0,199);
  20.  
  21.    /* move the object across the screen */
  22.  
  23.    fg_setcolor(10^15);
  24.    for (x = -20; x < 320; x+=5) {
  25.       fg_clprect(x,x+19,95,104);
  26.       fg_waitfor(1);
  27.       fg_clprect(x,x+19,95,104);
  28.       }
  29.  
  30.    /* restore the original video mode and return to DOS */
  31.  
  32.    fg_setmode(old_mode);
  33.    fg_reset();
  34. }
  35.